<!doctype html>
<html ng-app="hello" ng-controller="home">
<head>
<title>123123</title>
<link href="/css/angular-bootstrap.css">
<script type="text/javascript" src="js/angular-bootstrap.js"></script>
</head>

<body>


	<script type="text/javascript">
		angular.module('hello', ['ngRoute']).config(function($routeProvider, $httpProvider) {
			$httpProvider.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';

		}).controller('home', function($http) {
			var credentials = {};
			var headers = credentials ? {
				authorization : "Basic "
						+ btoa("eacdy0000@126.com" + ":"
								+ "123456")
			} : {};
			
			var mobileLogin = {"mobile":"aaa","vcode":"bbb"}
			var emailLogin = {"email":"eacdy0000@126.com","password":"123456"}
			
			$http.post('auth/mobile',mobileLogin).then(function(response) {
				console.log(response.data);
				
				if (response.data.name) {
					// $rootScope.authenticated = true;
				} else {
					// $rootScope.authenticated = false;
				}
				
			}); 
			
			$http.get('/member', 
				{headers:{
					"X-Auth-Token": "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiI4YTY5ODhlOC1lMDQxLTQ4ZDEtYTZmMy1hMTJjY2RjODM2YTQiLCJhdWRpZW5jZSI6Im1vYmlsZSIsImNyZWF0ZWQiOjE0NjU5NzE5MzQ1MTAsImV4cCI6MTQ2NjU3NjczNH0.NgK1OPyy7O4HpUR0RjYY8iRRNCOlWxzpIgN46vSKJbgOQX7kc8wamt8HO0gkoQvVUdMXYaMRFiWc0cWTUFsizw"
				}}).then(function(response) {
				console.log(response.data);
				
				if (response.data.name) {
				} else {
				}
			});
		});
	</script>
</body>
</html>
